<extend name="public@base5"/>
<block name="main">
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link" href="{:url('Menu/index')}">{:lang('ADMIN_MENU_INDEX')}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link active" href="{:url('Menu/add')}">{:lang('ADMIN_MENU_ADD')}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{:url('Menu/lists')}">{:lang('ADMIN_MENU_LISTS')}</a>
            </li>
        </ul>
        <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="admin/menus">
            <div class="row mb-3">
                <label for="input-parent_id" class="col-sm-2 col-form-label text-sm-end">
                    <span class="form-required">*</span>{:lang('Parent')}
                </label>
                <div class="col-md-8 col-sm-10">
                    <select class="form-control" name="parent_id" id="input-parent_id">
                        <option value="0">作为一级菜单</option>
                        {$select_category}
                    </select>
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-name" class="col-sm-2 col-form-label text-sm-end">
                    <span class="form-required">*</span>{:lang('Name')}
                </label>
                <div class="col-md-8 col-sm-10">
                    <input type="text" class="form-control" id="input-name" name="name">
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-app" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>应用</label>
                <div class="col-md-8 col-sm-10">
                    <input type="text" class="form-control" id="input-app" name="app">
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-controller" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>控制器</label>
                <div class="col-md-8 col-sm-10">
                    <input type="text" class="form-control" id="input-controller" name="controller">
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-action" class="col-sm-2 col-form-label text-sm-end"><span
                        class="form-required">*</span>方法</label>
                <div class="col-md-8 col-sm-10">
                    <input type="text" class="form-control" id="input-action" name="action">
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-param" class="col-sm-2 col-form-label text-sm-end">参数</label>
                <div class="col-md-8 col-sm-10">
                    <input type="text" class="form-control" id="input-param" name="param">
                    <p class="help-block">例:id=3&amp;p=3</p>
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-icon" class="col-sm-2 col-form-label text-sm-end">{:lang('Icon')}</label>
                <div class="col-md-8 col-sm-10">
                    <input type="text" class="form-control" id="input-icon" name="icon">
                    <p class="help-block">
                        <a href="http://www.thinkcmf.com/font/font_awesome/icons.html" target="_blank">选择图标</a>
                        如 <span class="badge text-bg-primary">fa fa-user</span> <span class="badge text-bg-primary">fa-regular fa-calendar-days</span> <span class="badge text-bg-primary">fa-solid fa-align-justify</span>
                        <span class="badge text-bg-primary">fa-brands fa-alipay</span>
                    </p>
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-remark" class="col-sm-2 col-form-label text-sm-end">{:lang('Remark')}</label>
                <div class="col-md-8 col-sm-10">
                    <textarea class="form-control" id="input-remark" name="remark"></textarea>
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-status" class="col-sm-2 col-form-label text-sm-end">{:lang('Status')}</label>
                <div class="col-md-8 col-sm-10" id="input-status">
                    <select class="form-control" name="status">
                        <option value="1">在左侧菜单显示</option>
                        <option value="0">在左侧菜单隐藏</option>
                    </select>
                </div>
            </div>
            <div class="row mb-3">
                <label for="input-type" class="col-sm-2 col-form-label text-sm-end">{:lang('Type')}</label>
                <div class="col-md-8 col-sm-10">
                    <select class="form-control" name="type" id="input-type">
                        <option value="1">有界面可访问菜单</option>
                        <option value="2">无界面可访问菜单</option>
                        <option value="0">只作为菜单</option>
                    </select>
                </div>
            </div>
            <div class="row mb-3">
                <div class="offset-md-2 col-sm-10">
                    <button type="submit" class="btn btn-primary js-ajax-submit">
                        <i class="fa fa-save fa-fw"></i> {:lang('ADD')}
                    </button>
                </div>
            </div>
        </form>
    </div>
</block>
